# -*- coding: utf-8 -*-
# -----------------------------------------
# @Time       : 2018/6/18 10:18
# @Author     : dqz 
# @Email      : 1406990390@qq.com
# @File       : tools.py
# @Software   : PyCharm
# -----------------------------------------
from utils.decorator import record_api_log
from utils.mysql import Mysql


@record_api_log
def create_db(conn, database):
    dbop = Mysql(conn)
    return dbop.create_database(database)


@record_api_log
def show_databases(conn):
    dbop = Mysql(conn)
    return dbop.get_databases()


@record_api_log
def show_tables(conn, database):
    dbop = Mysql(conn, database)
    return dbop.get_tables()


@record_api_log
def show_users(conn):
    dbop = Mysql(conn)
    return dbop.show_users()
